Skip to content

feat: support update credentials#4

Merged
BlackHole1 merged 1 commit intomainfrom
support-update-cred
Oct 31, 2025
Merged

feat: support update credentials#4
BlackHole1 merged 1 commit intomainfrom
support-update-cred

Conversation

@BlackHole1
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings October 31, 2025 08:15
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

  • New Features

    • Added method to update client credentials at runtime, supporting access key and token updates without reinitializing.
  • Chores

    • Updated package configuration to explicitly specify distribution and source directories in published package.

Walkthrough

package.json: added a top-level "files" array with ["dist", "src"]. src/client.ts: changed the Client constructor parameter from public readonly config to private config (removing public access), and added a new public method updateCredentials(accessKeyID, accessKeySecret, stsToken?) that merges new credentials into the stored config and reinitializes the request instance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review impact of changing public readonly configprivate config on external consumers and internal call sites.
  • Verify updateCredentials correctly merges values (no accidental loss of fields) and that reinitializing this.request preserves other runtime state.
  • Confirm no other code relied on direct client.config access (tests, docs, examples).
  • Quick check of package.json files intent and whether additional publish-related fields need adjustment.

Possibly related PRs

  • refactor: add client and remove basic #1 — earlier change introducing the Client with a public readonly config; directly related because this PR alters that visibility and adds credential update behavior.

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive No pull request description was provided by the author. While the lenient nature of this check means it should pass as long as the description is not completely off-topic, the absence of any description makes it impossible to determine whether it relates to or is disconnected from the changeset. Without any content to evaluate, it is unclear whether this satisfies the criterion of being "related in some way to the changeset."
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: support update credentials" follows the required format of <type>: <subject> correctly, using "feat" as the type and "support update credentials" as the subject. The title is clearly related to the primary change in the pull request, which adds a new public updateCredentials() method to the client class that allows updating credentials. This accurately summarizes the main feature addition, making the title relevant and descriptive of the changeset.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5a9ad3 and 316dc88.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/client.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/client.ts (2)
src/type.ts (1)
  • ClientConfig (3-9)
src/request.ts (1)
  • Request (11-57)
🔇 Additional comments (2)
package.json (1)

40-43: LGTM! Proper package inclusion configuration.

The files field correctly specifies which directories to include in the published npm package, ensuring both compiled output and source files are available.

src/client.ts (1)

6-6: Breaking change confirmed: config property is no longer publicly accessible.

The change from public readonly config to private config removes external access to the configuration object. While no code within this repository accesses client.config externally, this is a published library (as indicated by the exports field in package.json). Any downstream consumers relying on reading client.config will experience a breaking change.

Verify that this breaking change is intentional and acceptable for your library's versioning and release strategy.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds credential update functionality and refines package distribution configuration. The changes enable dynamic credential rotation for the Tablestore client while also ensuring proper package file inclusion.

  • Added updateCredentials method to support runtime credential updates
  • Changed config from public readonly to private to enable mutation
  • Added files field to package.json to explicitly specify package contents

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/client.ts Added updateCredentials method and changed config accessibility to support credential updates
package.json Added files field to control package distribution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1 BlackHole1 merged commit 0232380 into main Oct 31, 2025
1 of 2 checks passed
@BlackHole1 BlackHole1 deleted the support-update-cred branch October 31, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants